import request from "@/utils/http/axios";

class MenuApi {
    static loadMenus(){
        return request({
            url: "/menu/menus",
            method: "get"
        })
    }
    static listMenus(page, size){
        return request({
            url: "/menu/list?page="+page+"&size="+size,
            method: "get"
        })
    }

    static addMenu(data){
        return request({
            url: "/menu/addMenu",
            data: data,
            method: "post"
        })
    }

    static delMenu(menuId){
        return request({
            url: "/menu/delete?menuId="+menuId,
            method: "delete"
        })
    }

    static getMenusByRole(roleId){
        return request({
            url: "/menu/roleMenus",
            params: {roleId},
            method: "get"
        })
    }
}
export default MenuApi;